<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@ page import="userInteraction.createNewUser" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="createUser" class="userInteraction.createNewUser"></jsp:useBean>
<jsp:setProperty property="*" name="createUser"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<% 
	createNewUser user = new createNewUser();
	if(user.checkEmail(request.getParameter("emailAddress"))==true)
	{
		if(user.createUser(request.getParameter("emailAddress"), request.getParameter("firstName"), request.getParameter("lastName"), request.getParameter("password"), request.getParameter("phoneNumber"), request.getParameter("city"))==true)
		{
			session.setAttribute("registration", "true");
			response.sendRedirect("../User/index.jsp");
		}
		else
		{
			response.sendRedirect("../User/index.jsp?success=false");
		}
	}
	else
	{
		response.sendRedirect("../User/index.jsp");	
	}
%>
</body>
</html>